define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {
	$scope.form = {};
	
	$scope.form.fk_menuid=params.fk_menuid;
	$scope.form.type = "0";
	
	httpService.post(app.urls.rule_selectIcon,{},function(data){
		if("0000" === data.code){
			$scope.icons = data.data;
		}else{
			alert(data.msg);
		}
	});

	$scope.saveForm = function(){
		if($scope.formCheck()){
			httpService.post(app.urls.button_insert,$scope.form,function(data){
				if("0000" === data.code){
					eventBusService.publish("content.page.reload",data.data);
					eventBusService.publish("modal.page.close",{});
					$scope.form = {};
	    		}else{
	    			alert(data.msg);
	    		}
			});
		}
		
	}
}}});